package com.example.demo.mp.entity;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.*;
import com.example.demo.mp.typehandler.JsonObjectHandler;
import lombok.*;

import java.util.Date;



@Data
@TableName("userInfo")
public class Userinfo {
    @TableId(
            type = IdType.ASSIGN_ID
    )
    private Long id;
    /**
     * 姓名
     */
    @TableField(value = "name",condition = SqlCondition.LIKE)
    private String name;
    /**
     * 年龄
     */
    private Integer age;
    /**
     * 地址
     */
    private String address;
    /**
     * 性别
     */
    private Integer sex;
    /**
     * 邮箱
     */
    private String userAccount;
    private String userPassword;
    private String userEmail;
    private String userAvatar;
    private String nickName;
    private String phone;
    private String description;
    @TableField(typeHandler = JsonObjectHandler.class)
    private JSONObject config;
    /**
     * TableField exist  表示是否存在该字段，如果不存在，则不会进行数据库操作 仅程序内使用
     */
    @TableField(exist = false)
    private String status;
    @TableField(exist = false)
    private String role;

    /**
     * 表示逻辑删除 未删除0 删除 1
     */
    @TableLogic(value = "0",delval = "1")
    private int deleteFlag;

    private Date createTime;
    private Date updateTime;


    /**


     {
     "id": 1234567890,
     "newName": "张三",
     "age": 30,
     "address": "北京市朝阳区",
     "sex": 1,
     "userAccount": "zhangsan123",
     "userPassword": "password123",
     "userEmail": "zhangsan@example.com",
     "userAvatar": "https://example.com/avatar.jpg",
     "nickName": "三哥",
     "phone": "13812345678",
     "description": "这是张三的个人简介",
     "config": {
     "theme": "dark",
     "notifications": true,
     "language": "zh-CN"
     },
     "status": "active",
     "role": "admin",
     "deleteFlag": 0,
     "createTime": "2024-12-14T16:30:34",
     "updateTime": "2024-12-14T17:00:00"
     }


     */


}

